package org.hhhhb.example;

/**
 * @author mac
 */
public class DoubleLinkedListDemo {
}

class DoubleLinkedList{
    public Node head = new Node(0,"");

    /**
     * 按照no从低到高添加
     * @param node
     */
    public void addByOrder(Node node){

    }

    public void list(){
        Node temp = head.next;
        while (temp != null){
            System.out.println(temp);
            temp = temp.next;
        }
    }

}

class Node{
    public int no;
    public String name;
    public Node next;
    public Node pre;

    public Node(int no, String name) {
        this.no = no;
        this.name = name;
    }

    @Override
    public String toString() {
        return "Node{" +
                "no=" + no +
                ", name='" + name + '\'' +
                '}';
    }
}
